home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CU Amiga Super CD-ROM 19
/
CU Amiga Magazine's Super CD-ROM 19 (1998)(EMAP Images)(GB)[!][issue 1998-02].iso
/
CUCD
/
Programming
/
LEDA
/
prog
/
dict
/
dic.c
< prev
next >
Wrap
C/C++ Source or Header
|
1994-08-05
|
308b
|
24 lines
#include <LEDA/dictionary.h>
main()
{
dictionary<string,int> D;
dic_item it;
string s;
while (cin >> s)
{ it = D.lookup(s);
if (it==nil) D.insert(s,1);
else D.change_inf(it,D.inf(it)+1);
}
forall_items(it,D)
cout << D.key(it) << " : " << D.inf(it) << "\n";
return 0;
}